package com.crm.manager.mapper;

import com.crm.manager.domain.dto.TransferPageDTO;
import com.crm.manager.domain.vo.TransferVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface TransferMapper {
    List<TransferVO> pageQuery(@Param("dto") TransferPageDTO dto,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    @Update("update business set owner_id = #{toUserId}, owner = #{userName} where owner_id = #{fromUserId}")
    void assignment(@Param("fromUserId") Integer fromUserId,@Param("toUserId") Integer toUserId,@Param("userName") String userName);

    @Update("update clue set owner = #{targetUser} where owner = #{fromUser}")
    void assignmentClue(@Param("fromUser") String fromUser,@Param("targetUser") String targetUser);
}
